<html><head><title>CalendarGadget</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">CalendarGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>CalendarGadget</b></font>(#Gadget, x, y, Width, Height [, Date [, Flags]])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Create a calendar gadget in the current GadgetList. This gadget displays a month calendar and lets the 
user select a date. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
The position and dimensions of the new gadget. 

</td></tr>
<tr><td><i>Date (optional)</i></td>
<td> 
The initial date to set. The default is the current date. 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
This parameter can be set to <font color="#924B72">#PB_Calendar_Borderless</font> to create a gadget without 
a border. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

</blockquote><p><b>Remarks</b></p><blockquote>

The dates used by this gadget and the functions for it use the same date format as the 
<a href="../date/index.html">date library</a>. 
<br>
<br>
A 'mini help' can be added to this gadget using <a href="gadgettooltip.html">GadgetToolTip()</a>. 
<br>
<br>
The following functions can be used for this gadget: 
<br>
<br>
- <a href="setgadgetstate.html">SetGadgetState()</a>: Set the currently displayed date. 
<br>
- <a href="getgadgetstate.html">GetGadgetState()</a>: Get the currently displayed date. 
<br>
- <a href="setgadgetitemstate.html">SetGadgetItemState()</a>: Make a specific date appear bold (Windows only). 
<br>
- <a href="getgadgetitemstate.html">GetGadgetItemState()</a>: Get the bold state of a specific date (Windows only). 
<br>
- <a href="setgadgetattribute.html">SetGadgetAttribute()</a>: With the following attributes: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Calendar_Minimum</font>: Set the minimum selectable date
  <font color="#924B72">#PB_Calendar_Maximum</font>: Set the maximum selectable date in this gadget.
</font></pre>
- <a href="getgadgetattribute.html">GetGadgetAttribute()</a>: With the following attributes: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Calendar_Minimum</font>: Get the minimum selectable date
  <font color="#924B72">#PB_Calendar_Maximum</font>: Get the maximum selectable date of this gadget.
</font></pre>


<br>
This gadget supports the <a href="setgadgetcolor.html">SetGadgetColor()</a> and <a href="getgadgetcolor.html">GetGadgetColor()</a> functions with 
the following values as 'ColorType': 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Gadget_BackColor</font>      : backgroundcolor
  <font color="#924B72">#PB_Gadget_FrontColor</font>     : textcolor for displayed days (not supported on Windows Vista+)
  <font color="#924B72">#PB_Gadget_TitleBackColor</font> : backgroundcolor of the month title (not supported on Windows Vista+)
  <font color="#924B72">#PB_Gadget_TitleFrontColor</font>: textcolor of the month title (not supported on Windows Vista+)
  <font color="#924B72">#PB_Gadget_GrayTextColor</font>  : textcolor for days not of the current month (not supported on Windows Vista+)
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 220, 200, "CalendarGadget", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    CalendarGadget</font>(0, 10, 10, 200, 180)
    <b><font color="#006666">Repeat</font></b>
    <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/calendargadget.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="setgadgetstate.html">SetGadgetState()</a>, <a href="getgadgetstate.html">GetGadgetState()</a>, <a href="setgadgetitemstate.html">SetGadgetItemState()</a>, <a href="getgadgetitemstate.html">GetGadgetItemState()</a>, <a href="setgadgetattribute.html">SetGadgetAttribute()</a>, <a href="getgadgetattribute.html">GetGadgetAttribute()</a>, 
<a href="setgadgetcolor.html">SetGadgetColor()</a>, <a href="getgadgetcolor.html">GetGadgetColor()</a>, 
<a href="dategadget.html">DateGadget()</a>, <a href="../date/date.html">Date()</a>, <a href="../date/formatdate.html">FormatDate()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=buttonimagegadget.html>ButtonImageGadget()</a> - <a href=index.html>Gadget Index</a> - <a href=canvasgadget.html>CanvasGadget()</a> ->

</body></html>